package com.artqiyi.dollmachine.views.widget.dialog;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.artqiyi.dollmachine.R;
import com.artqiyi.dollmachine.utils.Rx2Timer;
import com.bumptech.glide.Glide;

import java.util.concurrent.TimeUnit;


/**
 * 充值dialog
 */
public class RxDialogPay extends RxDialog {

    private TextView mTvSure;
    private TextView mTvCancel;
    private ImageView mImageFail;

    public RxDialogPay(Context context, int themeResId) {
        super(context, themeResId);
        mContext = context;
        initView();
    }

    public RxDialogPay(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        mContext = context;
        initView();
    }

    public RxDialogPay(Context context) {
        super(context);
        mContext = context;
        initView();
    }

    public RxDialogPay(Activity context) {
        super(context);
        mContext = context;
        initView();
    }

    public RxDialogPay(Context context, float alpha, int gravity) {
        super(context, alpha, gravity);
        mContext = context;
        initView();
    }

    public TextView getSureView() {
        return mTvSure;
    }

    public void setCancel(String strCancel) {
        this.mTvCancel.setText(strCancel);
    }

    public TextView getCancelView() {
        return mTvCancel;
    }

    public void setSureListener(View.OnClickListener sureListener) {
        mTvSure.setOnClickListener(sureListener);
    }

    public void setCancelListener(View.OnClickListener cancelListener) {
        mTvCancel.setOnClickListener(cancelListener);
    }

    private void initView() {
        View dialog_view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_pay, null);
        mTvSure = (TextView) dialog_view.findViewById(R.id.tv_sure);
        mTvCancel = (TextView) dialog_view.findViewById(R.id.tv_cancel);
        mImageFail = (ImageView) dialog_view.findViewById(R.id.imageFail);
        setContentView(dialog_view);
        setCanceledOnTouchOutside(false);
    }

}
